package com.hujesse.service;


import com.hujesse.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

// 开启feign的注解，注意包的路径这里，不然autowired不了
@FeignClient(value = "springcloud-provider-dept",fallbackFactory = DeptServiceFallBackFactory.class)
public interface DeptService {
    // 添加一个部门
    @PostMapping("/add")
    String addDept( Dept dept);

    // 根据id查询部门
    @GetMapping("/get/{id}")
    String getId(@PathVariable("id") Long id);

    @GetMapping("/dept/list")
    String getList();

}
